<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1{
   width:195px;
}
.select_width{
   width:130px;
}
</style>
<script type="text/javascript">
	$(function(){
		var statYear = $('#stat_year').val();
		var sub_grant_code = $("input[name='proposal/sub_grant_code']").val();
		if (sub_grant_code == '700') {
			$('#start_date').val(statYear+'-01-01');
			$('#end_date').val((parseInt(statYear)+2)+'-12-31');
		}else if (sub_grant_code == '701'||sub_grant_code == '702'){
			$('#start_date').val(statYear+'-01-01');
			$('#end_date').val((parseInt(statYear)+1)+'-12-31');
		}else {
			$('#start_date').val('');
			$('#end_date').val('');
		}
	});
	
	/* function cntYear(seleceId){
		var statYear = $('#stat_year').val();
		var val = $("#"+seleceId).val();
		if (val == '01') {
			$('#start_date').val(statYear+'-01-01');
			$('#end_date').val((parseInt(statYear)+2)+'-12-31');
		}else if (val == '02'||val == '03'){
			$('#start_date').val(statYear+'-01-01');
			$('#end_date').val((parseInt(statYear)+1)+'-12-31');
		}else if (val == ''){
			$('#start_date').val('');
			$('#end_date').val('');
		}
	} */
	
	/**
	 * 选择树设置隐藏域值 public.js中原函数不适用，针对treeId中包含下标的情况
	 */
	function initTreeValueExt(treeId, treeNode) {

		if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
			scmWarn($("#" + treeId).attr("label")
					+ messageTip.researchAreaInvalidDisciplineCode);
			if (treeNode.level == 0) {
				$("#" + treeId).val("");
				$("#" + treeId).parents("td").find(
						"[name$='" + treeId + "_code'],[id$='" + treeId
								+ "_code']").val("");
				$("#" + treeId).parents("td").find(
						"[name$='" + treeId + "_value'],[id$='" + treeId
								+ "_value']").val("");
				$("#" + treeId).parents("td").find(
						"[name$='" + treeId + "_name'],[id$='" + treeId
								+ "_name']").val("");
			}

			return false;
		}

		var str = treeNode.name;
		var obj = treeNode.parentNode;

		while (obj != null) {
			obj = obj.parentNode;
		}

		$("#" + treeId).parents("td")
				.find(
						"[name$='" + treeId + "_code'],[id$='" + treeId
								+ "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find(
				"[name$='" + treeId + "_value'],[id$='" + treeId
						+ "_value']").val(treeNode.id);
		$("#" + treeId).parents("td")
				.find(
						"[name$='" + treeId + "_name'],[id$='" + treeId
								+ "_name']").val(str);

	}
	function sync0(id){
		var request_amt = parseFloat($('#'+id).val());
		if(!isNaN(request_amt)){
			$('#total_invest_26').val(request_amt);
		}else{
			$('#total_invest_26').val('');
		}
		
		var val1 = parseFloat($('#total_invest_28').val());
		var val2 = parseFloat($('#total_invest_26').val());
		if(isNaN(val1)){
			val1 = 0 ;
		}
		if(isNaN(val2)){
			val2 = 0 ;
		}
		$('#total_invest_27').val(val1-val2);
	}
	
	</script>
<x:parse xml="${param.xmlstr}" var="xmlData" />

<table class="t_css" width="100%" border="0" id="basicInfo" cellpadding="0"
	cellspacing="1">
	<tr>
		<td colspan="4" class="t_bar2">申请人信息</td>
	</tr>
	<tr>
		<td align="right" width="20%">姓名：</td> 
		<td width="25%">
			<span name="proposal/fzr_psnname"><x:out select="$xmlData/data/proposal/fzr_psnname" /></span>
		</td>
		
		<td align="right" width="15%">身份证号：</td>
		<td width="40%">
			<span name="proposal/fzr_idcard"><x:out select="$xmlData/data/proposal/fzr_idcard" /></span>
		</td>
	</tr>
	<tr>
		<td align="right" >学位：</td>
		<td >
		    <span name="proposal/degree_name"><x:out select="$xmlData/data/proposal/degree_name"/></span> 
		</td>
		<td align="right" >职称：</td>
		<td >
		<span name="proposal/prof_title_name"><x:out select='$xmlData/data/proposal/prof_title_name' /></span>
		</td>
	</tr>
	<tr>
		<td align="right" >手机号码：</td>
		<td >
			<span name="proposal/fzr_mobile"><x:out select="$xmlData/data/proposal/fzr_mobile" /></span> 
			<span name="proposal/fzr_tel_work" style="display: none;"><x:out select="$xmlData/data/proposal/fzr_tel_work" /></span>
		</td>
		<td align="right" >电子邮箱：</td>
		<td >
			<span name="proposal/fzr_mail"><x:out select="$xmlData/data/proposal/fzr_mail" /></span>
		</td>
	</tr>
	<tr>
		<td align="right" >
			工作单位全称： 
		</td>
		<td colspan="3">
			<span name="proposal/org_name"><x:out select="$xmlData/data/proposal/org_name" /></span>
		</td>
	</tr>
	<tr>
		<td align="right" ><span class="color_red">*</span>
			所在院系所：
		</td>
		<td colspan="3">
			<input  name="proposal/org_academy" label="申请人信息-->所在院系所" type="text" style="width: 525px;"  class="input_css required maxlength:30" value="<x:out select="$xmlData/data/proposal/org_academy" />"/> 
		</td>
	</tr>
	<tr>
		<td  align="right"><span class="color_red">*</span>
			通讯地址：
		</td>
		<td colspan="3">
		<input  name="proposal/address" label="申请人信息-->通讯地址" type="text" style="width: 525px;"  
		class="input_css required maxlength:50" value="<x:out select="$xmlData/data/proposal/address" />"/>
		</td>
	</tr>
	<tr>
		<td  align="right">
			主要研究领域：
		</td>
		<td colspan="3">
			 <span name="proposal/fzr_searcharea">
			 	<x:out select="$xmlData/data/proposal/fzr_searcharea"/>
			 </span>
		</td>
	</tr>
	<%-- <tr>
		<td  width="135" align="right"><span class="color_red">*</span>归口管理部门：</td>
		<td  colspan="5">
			<c:set var="recomend_org"><x:out select="$xmlData/data/proposal/recomend_org_value" /></c:set>
			<c:set var="sqOrgCode"><x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_code"/></c:set>
			<cpt:select id="recomend_org" sqlParamVal="{currentorgcode:${sqOrgCode }}"  key="proposal_tjbm"  value="${recomend_org}" onChange="initControlValue(this.id);"></cpt:select>
			<input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" class="required" value="${recomend_org}" label="申请人信息-->归口管理部门">
			<input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
		</td>
	</tr> --%>
	<tr>
	    <td  align="right"  ><span class="color_red">*</span>申报日期：</td>
		<td colspan="3">
			<c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
			<cpt:date id="submit_date" name="proposal/submit_date" value="${submit_date}" className="required date" label="申请人信息-->申报日期"></cpt:date> 
		</td>
	</tr>

	<tr>
		<td class="t_bar2" colspan="4">项目基本信息</td>
	</tr>
	<tr>
		<td align="right" ><span class="color_red">*</span>项目名称：</td>
		<td colspan="3">
		<input  name="proposal/zh_title" label="项目名称" type="text" class="input_css required maxlength:30" style="width: 525px;"  value="<x:out select="$xmlData/data/proposal/zh_title" />"/>
		</td>
	</tr>
	<%-- <tr>
		<td align="right" width="20%"><span class="color_red">*</span>资助类别：</td>
		<td colspan="" >
		<c:set var="funding_type_value"><x:out select="$xmlData/data/proposal/funding_type_value" /></c:set>
			<cpt:select id="funding_type"  key="funding_type"  className="select_width" value="${funding_type_value}" onChange="cntYear(this.id);"></cpt:select>
			<input type="hidden" name="proposal/funding_type_value" class="required" value="${funding_type_value}" label="资助类别">
			<input type="hidden" name="proposal/funding_type_name" value="<x:out select="$xmlData/data/proposal/funding_type_name" />">
		</td>
		<td align="right" width="20%"><span class="color_red">*</span>研究属性：</td>
		<td >
		<c:set var="research_type_value"><x:out select="$xmlData/data/proposal/research_type_value" /></c:set>
			<cpt:select id="research_type"  key="research_type"  className="select_width" value="${research_type_value}"></cpt:select>
			<input type="hidden" name="proposal/research_type_value" class="required" value="${research_type_value}" label="研究属性">
			<input type="hidden" name="proposal/research_type_name" value="<x:out select="$xmlData/data/proposal/research_type_name" />">
		</td>
	</tr> --%>
	<tr>
		<td align="right" ><span class="color_red">*</span>申请代码：</td>
		<td >   <c:set var="discipline_code"><x:out select="$xmlData/data/proposal/discipline_code" /></c:set>
					<c:set var="discipline">{'id':'${discipline_code}','name':'<x:out select="$xmlData/data/proposal/discipline_name" />'}</c:set>
					<c:set var="discipline_params">{grant_code:<x:out select="$xmlData/data/proposal/grant_code" />}</c:set>
					<input name="proposal/discipline_code" type="hidden" value="<x:out select="$xmlData/data/proposal/discipline_code" />" label="申请代码" class="required"/>
					<input name="proposal/discipline_name" type="hidden" value="<x:out select="$xmlData/data/proposal/discipline_name" />" />
					<input id="discipline_sqlParamVal" type="hidden" value="${discipline_params}" />
					<cpt:tree readonly="true" onlyChooseLeaf="" id="discipline" key="subject" name="discipline"  value="${discipline}"  onClick="initTreeValue"  sqlParamVal="" checkable="false"  label="申请代码"></cpt:tree>
		</td>
		<td  align="right"><span class="color_red">*</span>申请金额(万元)：</td>
	<td>
	<input  name="proposal/sqje" id="request_amt2" type="text" label="申请金额" 
   class="input_css gray required valueLENum:request_amt2:10.00" disabled style="text-align: right" 
   
   onfocus="InitInput.setNumber(this,7,4,2)" 
   value="<x:out select="$xmlData/data/proposal/sqje" />"/> 
	</td>
	</tr>
	<tr>
	    <td align="right" ><span class="color_red">*</span>研究属性：</td>
		<td width="30%" colspan="3">
		<c:set var="research_type_value"><x:out select="$xmlData/data/proposal/research_type_value" /></c:set>
			<cpt:select id="research_type"  key="research_type"  className="select_width" value="${research_type_value}"></cpt:select>
			<input type="hidden" name="proposal/research_type_value" class="required" value="${research_type_value}" label="研究属性">
			<input type="hidden" name="proposal/research_type_name" value="<x:out select="$xmlData/data/proposal/research_type_name" />">
	</tr>
	<tr>
	<td align="right" ><span class="color_red">*</span>研究期限：</td>
		<td colspan="3">
		<c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date" /></c:set>
		<cpt:date id="start_date" name="proposal/start_date"  value="${start_date}" className=" gray required date" label="研究期限开始日期" ></cpt:date>
		 &nbsp;—&nbsp;
		<c:set var="end_date"><x:out select="$xmlData/data/proposal/end_date" /></c:set>
	   <cpt:date id="end_date" name="proposal/end_date" className="required date gray" label="研究期限结束日期"  value="${end_date}" ></cpt:date>
		</td>
	</tr>
	<tr>
		<td align="right" >基地名称：</td>
		<td colspan="3">
		<input  name="proposal/base_title" label="基地名称" type="text" class="input_css  maxlength:100" style="width: 525px;"  value="<x:out select="$xmlData/data/proposal/base_title" />"/>
		</td>
	</tr>
	<tr>
		<td align="right" >基地类别：</td>
		<td colspan="3">
		<c:set var="base_type_value"><x:out select="$xmlData/data/proposal/base_type_value" /></c:set>
			<cpt:select id="base_type"  key="base_type"  value="${base_type_value}" onChange="initControlValue(this.id);"></cpt:select>
			<input type="hidden" name="proposal/base_type_value"  value="${base_type_value}" label="基地类别" >
			<input type="hidden" name="proposal/base_type_name" value="<x:out select="$xmlData/data/proposal/base_type_name" />">
		</td>
	</tr>
	<tr>
		<td align="right" ><span class="color_red">*</span>主题词：<br/>(主题词应反映研究内容，主题词数量不多于三个，各主题词之间以逗号隔开)</td>
		<td colspan="3">
		<input  name="proposal/keyword" id="keyword" label="主题词" type="text" class="input_css required maxlength:100" style="width: 525px;"  value="<x:out select="$xmlData/data/proposal/keyword" />"/>
		</td>
	</tr>
	</table>
	
	<table class="t_css" width="100%" border="0" cellpadding="0" cellspacing="1">
	<tr>
		<td class="t_bar2" colspan="4">依托单位信息</td>
	</tr>
	<tr>
		<td align="right" width="20%"><span class="color_red">*</span>单位名称：</td>
		<c:set var="org_name3"><x:out select="$xmlData/data/proposal/org_name3" /></c:set>
		<c:if test="${org_name3 == '' }">
			<c:set var="org_name3"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/org_name" /></c:set>
		</c:if>
		<td colspan="3">
		<input  name="proposal/org_name3" label="依托单位信息-->单位名称" type="text"  
		class="input_css required" style="width: 525px;"  maxlength="100" 
		value="${org_name3}" />
		</td>
	</tr>
	<tr>
		<td align="right" width="20%"><span class="color_red">*</span>联系人：</td>
		<c:set var="contact_psn3"><x:out select="$xmlData/data/proposal/contact_psn3" /></c:set>
		<c:if test="${contact_psn3 == '' }">
			<c:set var="contact_psn3"><x:out select="$xmlData/data/org/cotct_psn_name" /></c:set>
		</c:if>
		<td width="30%">
			<input name="proposal/contact_psn3" label="依托单位信息-->联系人" type="text" 
			 class="input_css required maxlength:30"  
			 value="${contact_psn3 }"/> 
		</td>
		<td align="right" width="20%"><span class="color_red">*</span>电子邮箱：</td>
		<c:set var="org_mail3"><x:out select="$xmlData/data/proposal/org_mail3" /></c:set>
		<c:if test="${org_mail3 == '' }">
			<c:set var="org_mail3"><x:out select="$xmlData/data/org/contct_psn_email" /></c:set>
		</c:if>
		<td width="30%">
			<input  name="proposal/org_mail3" label="依托单位信息-->电子邮箱" type="text"
			 required class="input_css required maxlength:30 email" 
			 value="${org_mail3}"/> 
		</td>
	</tr>
	<tr>
		<td align="right" width="20%"><span class="color_red">*</span>办公电话：</td>
		<c:set var="contact_phone"><x:out select="$xmlData/data/proposal/contact_phone" /></c:set>
		<c:if test="${contact_phone == '' }">
			<c:set var="contact_phone"><x:out select="$xmlData/data/org/contct_psn_tel" /></c:set>
		</c:if>
		<td width="30%">
			<input name="proposal/contact_phone" label="依托单位信息-->办公电话" type="text"
			 class="input_css required maxlength:20"  
			 value="${contact_phone }"/> 
		</td>
		<td align="right" width="20%"><span class="color_red">*</span>手机号码：</td>
		<c:set var="contact_mobile"><x:out select="$xmlData/data/proposal/contact_mobile" /></c:set>
		<c:if test="${contact_mobile == '' }">
			<c:set var="contact_mobile"><x:out select="$xmlData/data/org/contct_psn_mobile" /></c:set>
		</c:if>
		<td width="30%">
			<input  name="proposal/contact_mobile" label="依托单位信息-->手机号码" type="text" 
			onfocus="InitInput.setNumber(this,11,0,0)" class="input_css required maxlength:30 mobile" 
			value="${contact_mobile }"/> 
		</td>
	</tr>
</table>

<table class="t_css" width="100%" border="0" cellpadding="0" cellspacing="1" id="org1">
	<tr>
		<td class="t_bar2" colspan="4">合作研究单位信息</td>
	</tr>
	<tr>
		<td align="right" width="20%" >合作研究单位1：</td>
		<td colspan="3">
		<input  name="proposal/org_name1" label="合作单位信息1" type="text"  class="input_css maxlength:30" style="width: 525px;"  value="<x:out select="$xmlData/data/proposal/org_name1" />"/>
		</td>
	</tr>
	<tr>
		<td align="right" width="20%">合作研究单位2：</td>
		<td colspan="3">
		<input  name="proposal/org_name2" label="合作单位信息2" type="text"  class="input_css maxlength:30" style="width: 525px;"  value="<x:out select="$xmlData/data/proposal/org_name2" />"/>
		</td>
	</tr>
</table>

	
	
	



